package cn.com.zsc.acr120u;

import org.apache.commons.lang.StringUtils;

public class ACR120UReaderInfo {

	//获取卡号
	public String getCardID()
	{
		ACR120UReader reader = new ACR120UReader();
		reader.openReader();
		String cardID = reader.getCardID();
		if (StringUtils.isNumeric(cardID))
		{
			cardID=Long.toHexString(Long.parseLong(cardID));
		}
		else
			cardID = "";
		reader.close();
		return cardID.toUpperCase() ;
	}
	
	//读取卡信息
	public String queryACR120UReaderInfo()
	{
		ACR120UReader reader = new ACR120UReader();
		reader.openReader();
		return reader.readString();
	}
	
	//写卡信息
	public void writeACR120UReaderInfo(String writeinfo)
	{
		ACR120UReader reader = new ACR120UReader();
		reader.openReader();
		reader.writeString(writeinfo);
	}
	
	public static void main(String args[])
	{
		ACR120UReaderInfo info= new ACR120UReaderInfo();
		info.writeACR120UReaderInfo("Z034");
		System.out.println(info.queryACR120UReaderInfo());
	}
	
}
